package com.yt.phone.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.phone.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.phone.mapper.UserMapper;
import com.yt.phone.models.service.IUserService;
import com.yt.phone.models.bo.UserSaveBO;
import com.yt.phone.models.dto.UserDTO;

/**
 * 客户信息控制器
 *
 * @author lizicong
 * @Date 2025-11-07 13:31:17
 */
@DubboService
public class UserServiceImpl extends ServiceImpl<UserMapper, UserDTO> implements IUserService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(UserSaveBO saveBO) {
        UserDTO dto = new UserDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
    @Override
    public boolean updateByUserId(UserDTO userDTO) {
        return this.updateById(userDTO);
    }
}
